﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace SystemCenterSoa.Repository.Migrations
{
    public partial class zf : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Accessory",
                columns: table => new
                {
                    fileId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    fileName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    uploadTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    fileSize = table.Column<int>(type: "int", nullable: false),
                    fileType = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    dustomerSerialNum = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Accessory", x => x.fileId);
                });

            migrationBuilder.CreateTable(
                name: "AdminUser",
                columns: table => new
                {
                    user_name = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    pass_word = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_full_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    user_status = table.Column<int>(type: "int", nullable: false),
                    last_lgoin_date = table.Column<DateTime>(type: "datetime2", nullable: true),
                    last_login_ip = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    modifi_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    modifi_date = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AdminUser", x => x.user_name);
                });

            migrationBuilder.CreateTable(
                name: "AdminUserRoleRelation",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    user_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    role_id = table.Column<int>(type: "int", nullable: false),
                    creator_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AdminUserRoleRelation", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "architectural_title",
                columns: table => new
                {
                    atle_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    atle_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    atle_pt_value = table.Column<decimal>(type: "decimal(18,4)", nullable: false),
                    atle_sort = table.Column<int>(type: "int", nullable: false),
                    atle_describe = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_architectural_title", x => x.atle_id);
                });

            migrationBuilder.CreateTable(
                name: "AttenStatistical",
                columns: table => new
                {
                    sta_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    sta_name = table.Column<int>(type: "int", nullable: false),
                    sta_DepartmentName = table.Column<int>(type: "int", nullable: false),
                    sta_Professional = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_AttenStatistical", x => x.sta_id);
                });

            migrationBuilder.CreateTable(
                name: "build_type",
                columns: table => new
                {
                    build_type_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    build_type_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    build_type_parentid = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_build_type", x => x.build_type_id);
                });

            migrationBuilder.CreateTable(
                name: "CategoryContractAmount",
                columns: table => new
                {
                    cc_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cc_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_civil = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_industrial = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_reconnaissance = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_supervision = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_construction = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_consulting = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_contracted = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_AgentConstruction = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CategoryContractAmount", x => x.cc_id);
                });

            migrationBuilder.CreateTable(
                name: "CategoryCount",
                columns: table => new
                {
                    cc_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cc_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_civil = table.Column<int>(type: "int", nullable: false),
                    cc_industrial = table.Column<int>(type: "int", nullable: false),
                    cc_reconnaissance = table.Column<int>(type: "int", nullable: false),
                    cc_supervision = table.Column<int>(type: "int", nullable: false),
                    cc_construction = table.Column<int>(type: "int", nullable: false),
                    cc_consulting = table.Column<int>(type: "int", nullable: false),
                    cc_contracted = table.Column<int>(type: "int", nullable: false),
                    cc_AgentConstruction = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CategoryCount", x => x.cc_id);
                });

            migrationBuilder.CreateTable(
                name: "CategoryReceipts",
                columns: table => new
                {
                    cc_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cc_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_civil = table.Column<float>(type: "real", nullable: false),
                    cc_industrial = table.Column<float>(type: "real", nullable: false),
                    cc_reconnaissance = table.Column<float>(type: "real", nullable: false),
                    cc_supervision = table.Column<float>(type: "real", nullable: false),
                    cc_construction = table.Column<float>(type: "real", nullable: false),
                    cc_consulting = table.Column<float>(type: "real", nullable: false),
                    cc_contracted = table.Column<float>(type: "real", nullable: false),
                    cc_AgentConstruction = table.Column<float>(type: "real", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CategoryReceipts", x => x.cc_id);
                });

            migrationBuilder.CreateTable(
                name: "CategoryScale",
                columns: table => new
                {
                    cc_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cc_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_civil = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_industrial = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_reconnaissance = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_supervision = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_construction = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_consulting = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_contracted = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    cc_AgentConstruction = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_CategoryScale", x => x.cc_id);
                });

            migrationBuilder.CreateTable(
                name: "Comprehensive",
                columns: table => new
                {
                    com_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    DeptId = table.Column<int>(type: "int", nullable: false),
                    com_sum = table.Column<int>(type: "int", nullable: false),
                    com_Scale = table.Column<int>(type: "int", nullable: false),
                    com_through = table.Column<int>(type: "int", nullable: false),
                    com_ongoing = table.Column<int>(type: "int", nullable: false),
                    com_suspended = table.Column<int>(type: "int", nullable: false),
                    com_complete = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Comprehensive", x => x.com_id);
                });

            migrationBuilder.CreateTable(
                name: "contract",
                columns: table => new
                {
                    contract_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    contract_account = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    contract_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    construct_unit = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    structural_type_id = table.Column<int>(type: "int", nullable: false),
                    project_leader_id = table.Column<int>(type: "int", nullable: false),
                    first_leader = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    original_amount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    drawing_num = table.Column<int>(type: "int", nullable: false),
                    build_type_id = table.Column<int>(type: "int", nullable: false),
                    project_leader_tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    first_leader_tel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    real_amount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    trip_num = table.Column<int>(type: "int", nullable: false),
                    contract_type_id = table.Column<int>(type: "int", nullable: false),
                    first_party_type_id = table.Column<int>(type: "int", nullable: false),
                    covered_area = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    subsidiary_corporation = table.Column<int>(type: "int", nullable: false),
                    project_site = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    contract_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    contractual_permissible_state = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    contract_note = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    contract_text_id = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    customers_id = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_contract", x => x.contract_id);
                });

            migrationBuilder.CreateTable(
                name: "ContractPayment",
                columns: table => new
                {
                    cp_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    contract_id = table.Column<int>(type: "int", nullable: false),
                    cp_schedule = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cp_state = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ContractPayment", x => x.cp_id);
                });

            migrationBuilder.CreateTable(
                name: "ContraProjeComprStati",
                columns: table => new
                {
                    cpcs_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cpcs_Department = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cpcs_customerInformation = table.Column<int>(type: "int", nullable: false),
                    cpcs_contractInformation = table.Column<int>(type: "int", nullable: false),
                    cpcs_ProjectInformation = table.Column<int>(type: "int", nullable: false),
                    cpcs_UnplannedProject = table.Column<int>(type: "int", nullable: false),
                    cpcs_PlannedProject = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ContraProjeComprStati", x => x.cpcs_id);
                });

            migrationBuilder.CreateTable(
                name: "country",
                columns: table => new
                {
                    country_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    country_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    p_id = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_country", x => x.country_id);
                });

            migrationBuilder.CreateTable(
                name: "Customer",
                columns: table => new
                {
                    customerId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    customerReferred = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    customerName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    companyAddress = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    postalCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    linkman = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    comparyTel = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    faxNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    dustomerSerialNum = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    createTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    createName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    englishName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cooperation = table.Column<int>(type: "int", nullable: false),
                    countryId = table.Column<int>(type: "int", nullable: false),
                    provinceId = table.Column<int>(type: "int", nullable: false),
                    cityId = table.Column<int>(type: "int", nullable: false),
                    typeId = table.Column<int>(type: "int", nullable: false),
                    industryId = table.Column<int>(type: "int", nullable: false),
                    embranchment = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    homePage = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    relationTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    relationDepartment = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creditRatingsId = table.Column<int>(type: "int", nullable: false),
                    intimacyId = table.Column<int>(type: "int", nullable: false),
                    bankName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    bankAccount = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    enterpriseCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    member = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    taxpayerCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    remark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    jiafuId = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Customer", x => x.customerId);
                });

            migrationBuilder.CreateTable(
                name: "Department",
                columns: table => new
                {
                    deptId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    deptNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    deptName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    depDepartment = table.Column<int>(type: "int", nullable: false),
                    deptIndex = table.Column<int>(type: "int", nullable: false),
                    deptDesc = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    deptTypeId = table.Column<int>(type: "int", nullable: false),
                    staffId = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Department", x => x.deptId);
                });

            migrationBuilder.CreateTable(
                name: "dictionaries",
                columns: table => new
                {
                    dic_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    dic_key = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    dic_type_key = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    dic_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    dic_describe = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    modifi_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    modifi_date = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_dictionaries", x => x.dic_id);
                });

            migrationBuilder.CreateTable(
                name: "Drive",
                columns: table => new
                {
                    dri_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    sta_id = table.Column<int>(type: "int", nullable: false),
                    dri_mileage = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    dri_Number = table.Column<int>(type: "int", nullable: false),
                    dri_Time = table.Column<DateTime>(type: "datetime2", nullable: false),
                    dri_Cost = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    dri_Subtotal = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    dri_Summation = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    dri_SummationT = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    dri_projectName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    dri_Signatory = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Drive", x => x.dri_id);
                });

            migrationBuilder.CreateTable(
                name: "evection_apply",
                columns: table => new
                {
                    cc_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    cc_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_place = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_start_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    cc_end_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    cc_note = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_mileage = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_evection_apply", x => x.cc_id);
                });

            migrationBuilder.CreateTable(
                name: "ExamineAndApprove",
                columns: table => new
                {
                    eaa_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    eaa_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    eaa_number = table.Column<int>(type: "int", nullable: false),
                    eaa_signed = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    eaa_building = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    eaa_money = table.Column<float>(type: "real", nullable: false),
                    eaa_through = table.Column<int>(type: "int", nullable: false),
                    eaa_moment = table.Column<int>(type: "int", nullable: false),
                    eaa_NotA = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ExamineAndApprove", x => x.eaa_id);
                });

            migrationBuilder.CreateTable(
                name: "field_apply",
                columns: table => new
                {
                    wq_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    wq_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    wq_place = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    cc_start_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    cc_end_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    cc_jbdate = table.Column<int>(type: "int", nullable: false),
                    cc_mileage = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_field_apply", x => x.wq_id);
                });

            migrationBuilder.CreateTable(
                name: "Holidays",
                columns: table => new
                {
                    hol_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    sta_id = table.Column<int>(type: "int", nullable: false),
                    hol_vacate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_late = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_overtime = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_AnnualLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_MarriageLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_MaternityLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_FuneralLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_PersonalLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_SickLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_note = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_lastAnnualLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_currentAnnualLeave = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_LastYear = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    hol_ThisYear = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Holidays", x => x.hol_id);
                });

            migrationBuilder.CreateTable(
                name: "leave_apply",
                columns: table => new
                {
                    qj_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    qj_reason = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    qj_start_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    qj_end_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    qj_kqtj = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    qj_note = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_leave_apply", x => x.qj_id);
                });

            migrationBuilder.CreateTable(
                name: "Level",
                columns: table => new
                {
                    lev_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    lev_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    lev_quantity = table.Column<int>(type: "int", nullable: false),
                    lev_ContractAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    lev_receipts = table.Column<float>(type: "real", nullable: false),
                    lev_quantityO = table.Column<int>(type: "int", nullable: false),
                    lev_ContractAmountO = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    lev_receiptsO = table.Column<float>(type: "real", nullable: false),
                    lev_quantityT = table.Column<int>(type: "int", nullable: false),
                    lev_ContractAmountT = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    lev_receiptsT = table.Column<float>(type: "real", nullable: false),
                    lev_quantityS = table.Column<int>(type: "int", nullable: false),
                    lev_ContractAmountS = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    lev_receiptsS = table.Column<float>(type: "real", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Level", x => x.lev_id);
                });

            migrationBuilder.CreateTable(
                name: "ModuleDb",
                columns: table => new
                {
                    module_code = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    module_name = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
                    parent_code = table.Column<string>(type: "nvarchar(100)", maxLength: 100, nullable: false),
                    module_level = table.Column<int>(type: "int", nullable: false),
                    is_menu = table.Column<int>(type: "int", nullable: false),
                    is_action = table.Column<int>(type: "int", nullable: false),
                    action_url = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    order_by = table.Column<decimal>(type: "decimal(18,4)", nullable: false),
                    module_status = table.Column<int>(type: "int", nullable: false),
                    creator_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    modifi_name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: true),
                    modifi_date = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ModuleDb", x => x.module_code);
                });

            migrationBuilder.CreateTable(
                name: "NaturesContractAmount",
                columns: table => new
                {
                    nn_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    nn_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    nn_public = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_RealEstate = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_municipal = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_hospital = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_electricity = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_communication = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_bank = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_school = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    nn_ForeignRelated = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_NaturesContractAmount", x => x.nn_id);
                });

            migrationBuilder.CreateTable(
                name: "NaturesNumber",
                columns: table => new
                {
                    nn_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    nn_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    nn_public = table.Column<int>(type: "int", nullable: false),
                    nn_RealEstate = table.Column<int>(type: "int", nullable: false),
                    nn_municipal = table.Column<int>(type: "int", nullable: false),
                    nn_hospital = table.Column<int>(type: "int", nullable: false),
                    nn_electricity = table.Column<int>(type: "int", nullable: false),
                    nn_communication = table.Column<int>(type: "int", nullable: false),
                    nn_bank = table.Column<int>(type: "int", nullable: false),
                    nn_school = table.Column<int>(type: "int", nullable: false),
                    nn_ForeignRelated = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_NaturesNumber", x => x.nn_id);
                });

            migrationBuilder.CreateTable(
                name: "NaturesReceipts",
                columns: table => new
                {
                    nn_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    nn_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    nn_public = table.Column<float>(type: "real", nullable: false),
                    nn_RealEstate = table.Column<float>(type: "real", nullable: false),
                    nn_municipal = table.Column<float>(type: "real", nullable: false),
                    nn_hospital = table.Column<float>(type: "real", nullable: false),
                    nn_electricity = table.Column<float>(type: "real", nullable: false),
                    nn_communication = table.Column<float>(type: "real", nullable: false),
                    nn_bank = table.Column<float>(type: "real", nullable: false),
                    nn_school = table.Column<float>(type: "real", nullable: false),
                    nn_ForeignRelated = table.Column<float>(type: "real", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_NaturesReceipts", x => x.nn_id);
                });

            migrationBuilder.CreateTable(
                name: "Objective",
                columns: table => new
                {
                    obj_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    obj_production = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    obj_year = table.Column<int>(type: "int", nullable: false),
                    obj_target = table.Column<int>(type: "int", nullable: false),
                    obj_contractAmount = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    obj_proportion = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    obj_beginTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    obj_endTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    obj_outputValue = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    obj_putValue = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    obj_proportionTwo = table.Column<decimal>(type: "decimal(18,2)", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Objective", x => x.obj_id);
                });

            migrationBuilder.CreateTable(
                name: "Overview",
                columns: table => new
                {
                    over_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    over_Engineering = table.Column<int>(type: "int", nullable: false),
                    over_startTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    over_endTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    over_phase = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Overview", x => x.over_id);
                });

            migrationBuilder.CreateTable(
                name: "qualification",
                columns: table => new
                {
                    qua_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    qua_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    qua_start_date = table.Column<DateTime>(type: "datetime2", nullable: true),
                    qua_end_date = table.Column<DateTime>(type: "datetime2", nullable: true),
                    qua_annual_audit_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    qua_content = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    que_level = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_qualification", x => x.qua_id);
                });

            migrationBuilder.CreateTable(
                name: "ResponsiblePerson",
                columns: table => new
                {
                    serialId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    serialNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personJob = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personDepartment = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personPhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personEmail = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personRemark = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personBusinessCal = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personHomePhone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personBusinessFax = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    personResidentialFax = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_ResponsiblePerson", x => x.serialId);
                });

            migrationBuilder.CreateTable(
                name: "RoleDb",
                columns: table => new
                {
                    role_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    role_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    role_status = table.Column<int>(type: "int", nullable: false),
                    creator_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    modifi_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    modifi_date = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RoleDb", x => x.role_id);
                });

            migrationBuilder.CreateTable(
                name: "RoleModuleRelation",
                columns: table => new
                {
                    id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    role_id = table.Column<int>(type: "int", nullable: false),
                    module_code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_RoleModuleRelation", x => x.id);
                });

            migrationBuilder.CreateTable(
                name: "SatisfactionSurvey",
                columns: table => new
                {
                    satisfiedID = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    satisfactionSurveySerialNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    methodId = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    satisfactionId = table.Column<int>(type: "int", nullable: false),
                    surveyContent = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    surveyTime = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    surveyCause = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    mostSatisfying = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    mostUnSatisfying = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    remark = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_SatisfactionSurvey", x => x.satisfiedID);
                });

            migrationBuilder.CreateTable(
                name: "Staff",
                columns: table => new
                {
                    staffId = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    staffNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    loginName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    staffName = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    staffTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    sex = table.Column<int>(type: "int", nullable: false),
                    deptId = table.Column<int>(type: "int", nullable: false),
                    majorId = table.Column<int>(type: "int", nullable: false),
                    roleId = table.Column<int>(type: "int", nullable: false),
                    passWord = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    email = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    phone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    telephone = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    professionalId = table.Column<int>(type: "int", nullable: false),
                    managementId = table.Column<int>(type: "int", nullable: false),
                    technologyId = table.Column<int>(type: "int", nullable: false),
                    deptIds = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    state = table.Column<int>(type: "int", nullable: false),
                    img = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    order = table.Column<int>(type: "int", nullable: false),
                    entryTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    resignationTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Staff", x => x.staffId);
                });

            migrationBuilder.CreateTable(
                name: "Structural_style",
                columns: table => new
                {
                    structural_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    structural_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    structural_parentid = table.Column<int>(type: "int", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Structural_style", x => x.structural_id);
                });

            migrationBuilder.CreateTable(
                name: "Summary",
                columns: table => new
                {
                    sum_id = table.Column<int>(type: "int", nullable: false)
                        .Annotation("SqlServer:Identity", "1, 1"),
                    sta_id = table.Column<int>(type: "int", nullable: false),
                    sta_overtime = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    sta_WeekOvertime = table.Column<decimal>(type: "decimal(18,2)", nullable: false),
                    sta_Remind = table.Column<string>(type: "nvarchar(max)", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Summary", x => x.sum_id);
                });

            migrationBuilder.CreateTable(
                name: "web_system_menu",
                columns: table => new
                {
                    wm_code = table.Column<string>(type: "nvarchar(450)", nullable: false),
                    wm_parent_code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    wm_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    wm_level = table.Column<int>(type: "int", nullable: false),
                    wm_url = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    wm_module_code = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    wm_order = table.Column<decimal>(type: "decimal(18,4)", nullable: false),
                    wm_status = table.Column<int>(type: "int", nullable: false),
                    creator_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    creator_date = table.Column<DateTime>(type: "datetime2", nullable: false),
                    modifi_name = table.Column<string>(type: "nvarchar(max)", nullable: true),
                    modifi_date = table.Column<DateTime>(type: "datetime2", nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_web_system_menu", x => x.wm_code);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Accessory");

            migrationBuilder.DropTable(
                name: "AdminUser");

            migrationBuilder.DropTable(
                name: "AdminUserRoleRelation");

            migrationBuilder.DropTable(
                name: "architectural_title");

            migrationBuilder.DropTable(
                name: "AttenStatistical");

            migrationBuilder.DropTable(
                name: "build_type");

            migrationBuilder.DropTable(
                name: "CategoryContractAmount");

            migrationBuilder.DropTable(
                name: "CategoryCount");

            migrationBuilder.DropTable(
                name: "CategoryReceipts");

            migrationBuilder.DropTable(
                name: "CategoryScale");

            migrationBuilder.DropTable(
                name: "Comprehensive");

            migrationBuilder.DropTable(
                name: "contract");

            migrationBuilder.DropTable(
                name: "ContractPayment");

            migrationBuilder.DropTable(
                name: "ContraProjeComprStati");

            migrationBuilder.DropTable(
                name: "country");

            migrationBuilder.DropTable(
                name: "Customer");

            migrationBuilder.DropTable(
                name: "Department");

            migrationBuilder.DropTable(
                name: "dictionaries");

            migrationBuilder.DropTable(
                name: "Drive");

            migrationBuilder.DropTable(
                name: "evection_apply");

            migrationBuilder.DropTable(
                name: "ExamineAndApprove");

            migrationBuilder.DropTable(
                name: "field_apply");

            migrationBuilder.DropTable(
                name: "Holidays");

            migrationBuilder.DropTable(
                name: "leave_apply");

            migrationBuilder.DropTable(
                name: "Level");

            migrationBuilder.DropTable(
                name: "ModuleDb");

            migrationBuilder.DropTable(
                name: "NaturesContractAmount");

            migrationBuilder.DropTable(
                name: "NaturesNumber");

            migrationBuilder.DropTable(
                name: "NaturesReceipts");

            migrationBuilder.DropTable(
                name: "Objective");

            migrationBuilder.DropTable(
                name: "Overview");

            migrationBuilder.DropTable(
                name: "qualification");

            migrationBuilder.DropTable(
                name: "ResponsiblePerson");

            migrationBuilder.DropTable(
                name: "RoleDb");

            migrationBuilder.DropTable(
                name: "RoleModuleRelation");

            migrationBuilder.DropTable(
                name: "SatisfactionSurvey");

            migrationBuilder.DropTable(
                name: "Staff");

            migrationBuilder.DropTable(
                name: "Structural_style");

            migrationBuilder.DropTable(
                name: "Summary");

            migrationBuilder.DropTable(
                name: "web_system_menu");
        }
    }
}
